package com.pig4cloud.pig.iotData.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.pig4cloud.pig.common.core.util.R;
import com.pig4cloud.pig.iotData.entity.IotDataKgbotcamFileEntity;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.scheduling.annotation.Async;
import org.springframework.web.multipart.MultipartFile;

public interface IotDataKgbotcamFileService extends IService<IotDataKgbotcamFileEntity> {
	/**
	 * 上传多肉图片文件，进行检测,传递参数方式1
	 * @param file
	 * @return
	 */
	R uploadToDetectFile(MultipartFile file, IotDataKgbotcamFileEntity duorouKgbotcamFile);



	/**
	 * 上传检测后的多肉图片文件
	 * @param file
	 * @return
	 */
	R uploadDetectedFile(MultipartFile file,Long duorouFileId);

	/**
	 * 读取文件
	 * @param fileDir 桶名称
	 * @param fileName 文件名称
	 * @param response 输出流
	 */
	void getFile(String fileDir, String fileName, HttpServletResponse response);

	/**
	 * 删除文件
	 * @param id
	 * @return
	 */
	Boolean deleteFile(Long id);


	/**
	 * 开启异步多肉检测任务
	 * @param iotDataKgbotcamFileEntity
	 */
	@Async("duorouFileDetTaskExecutor")
	public void detDuoRouFileExecutor(IotDataKgbotcamFileEntity iotDataKgbotcamFileEntity);
}